#include "MySqlStatementImpl.h"
#include "../../../../../utils/instanceof.h"
#include "../../visitor/MySqlASTVisitor.h"
#include "../../../../../Exception/IllegalArgumentException.h"
#include "../../../../../Exception/UnsupportedOperationException.h"

MySqlStatementImpl::MySqlStatementImpl()
    : SQLStatementImpl(DbType_ptr(new DbType(&DbType::mysql)))
{
}

void MySqlStatementImpl::accept0(SQLASTVisitor_ptr visitor)
{
  if (instanceof <SQLASTVisitor, MySqlASTVisitor>(visitor.get()))
  {
    MySqlASTVisitor_ptr tmp = std::dynamic_pointer_cast<MySqlASTVisitor>(visitor);
    accept0(tmp);
  }
  else
  {
    throw new IllegalArgumentException(make_string_ptr("not support visitor type : " + *visitor->getClass()));
  }
}

void MySqlStatementImpl::accept0(MySqlASTVisitor_ptr v)
{
  throw new UnsupportedOperationException(this->getClass());
}

SQLObject_list_ptr MySqlStatementImpl::getChildren()
{
  throw new UnsupportedOperationException(this->getClass());
}
